
//用户名  
jQuery.validator.addMethod("isUserName", function (value, element) {
    var regUserName1 = /^(?![0-9]+$)(?![a-zA-Z]+$)[0-9A-Za-z]{6,16}$/;
    var regUserName2 = /^[a-zA-Z]{6,16}$/;
	return this.optional(element) || (regUserName1.test(value) || regUserName2.test(value));
}, "6~16位，由纯字母或字母、数字组成");


//手机号  
jQuery.validator.addMethod("isMobile", function (value, element) {
    var isMobile = /^1[3|4|5|7|8]\d{9}$/;
	return this.optional(element) || (isMobile.test(value));
}, "手机格式不正确");
//邮箱号码
jQuery.validator.addMethod("isEmail", function (value, element) {
    var isEmail = /^[a-z0-9]+([._\\-]*[a-z0-9])*@([a-z0-9]+[-a-z0-9]*[a-z0-9]+.){1,63}[a-z0-9]+$/;
	return this.optional(element) || (isEmail.test(value));
}, "邮箱格式不正确");

//密码  	
jQuery.validator.addMethod("isPwd", function (value, element) {
    var ispwd = /^(?![0-9]+$)(?![a-zA-Z]+$)[0-9A-Za-z]{6,16}$/ ;
	return this.optional(element) || (ispwd.test(value));
}, "6~16 位，由数字、字母组成，区分大小写");

//验证码0-4a-zA-Z
jQuery.validator.addMethod("authcode", function (value, element) {
    var authcode = /[a-zA-Z0-9]{4}/;
	return this.optional(element) || (authcode.test(value));
}, "验证码错误");

//验证码0-9
jQuery.validator.addMethod("smscode", function (value, element) {
    var authcode = /\b\d{6}\b/;
	return this.optional(element) || (authcode.test(value));
}, "验证码格式错误");
//验证码0-9
jQuery.validator.addMethod("checkcode", function (value, element) {
    var authcode = /\b\d{6}\b/;
	return this.optional(element) || (authcode.test(value));
}, "请输入6位有效格式数字");
//验证支付宝账号
jQuery.validator.addMethod("isAlipay", function (value, element) {
    var eamil = /^\w+([-\.]\w+)*@\w+([\.-]\w+)*\.\w{2,4}$/;
    var phone = /^1((3)|(4)|(5)|(8)|(9)|(7))[0-9]{9}$/;
	return this.optional(element) || (eamil.test(value)) || (phone.test(value));
}, "格式不正确");
///^\d{16}|\d{19}$/
jQuery.validator.addMethod("isBank", function (value, element) {
    var bank = /^\d{16}|\d{19}$/;
	return this.optional(element) || (bank.test(value)) ;
}, "格式不正确");

jQuery.validator.addMethod("isName", function (value, element) {
    var name = /^([\u4E00-\uFA29]|[\uE7C7-\uE7F3]){2,10}$/;
	return this.optional(element) || (name.test(value)) ;
}, "姓名格式不正确");
////验证金额
jQuery.validator.addMethod("isAmount", function (value, element) {
    var isAmount = /^[0-9]*$/;
	return this.optional(element) || (isAmount.test(value));
}, "格式输入有误");
////推荐人号码验证
//jQuery.validator.addMethod("isrecommendCode", function (value, element) {
//    var telcode = /^[0-9]*$/;
//	return this.optional(element) || (telcode.test(value));
//}, "邀请码必须数字/手机号必须是11位数字");


























	
	
	
	
	
	
	
